package com.saltfish.library.servicelmp;

import com.saltfish.library.mapper.DoPlanMapper;
import com.saltfish.library.pojo.DoPlan;
import com.saltfish.library.sevice.DoPlanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("DoPlanService")
public class DoPlanServiceImpl implements DoPlanService {

    @Resource
    DoPlanMapper doPlanMapper;


    @Override
    public List<DoPlan> list() {
        return doPlanMapper.selectdp();
    }

    @Override
    public List<DoPlan> dpSelect(String sid) {
        return doPlanMapper.selectDoPlan(sid);
    }

    @Override
    public boolean dpInert(DoPlan doPlan) {
        int n=doPlanMapper.dpInsert(doPlan);
        if(n>0)
            return true;
        return false;
    }

    @Override
    public boolean dpDelete(String dpid) {
        int n=doPlanMapper.dpDelete(dpid);
        if(n>0)
            return true;
        return false;
    }

    @Override
    public boolean dpDelete(String[] dpid) {
        int n=doPlanMapper.dpDeleteAll(dpid);
        if(n>0)
            return true;
        return false;
    }


}
